﻿
using Maticsoft.BLL;
using Maticsoft.Model;

using System;
using System.Collections.Specialized;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

public partial class WebPage_SheZhi_XuanXiang : SystemBBasePage
{
    private NameValueCollection _system = null;

    public string check1 = "";
    public string check2 = "";
  
    public bool result = false;

    public SystemConfig sysmodel = new SystemConfig();
    private Maticsoft.BLL.System systems = new Maticsoft.BLL.System();

    protected void commit_Click(object sender, EventArgs e)
    {
        Maticsoft.Model.System model = new Maticsoft.Model.System();
        model = this.systems.GetModel(1);
        model.Navpartner = int.Parse(this.navpartner.SelectedItem.Value);
        model.Navseconds = int.Parse(this.navseconds.SelectedItem.Value);
        model.Navgoods = int.Parse(this.navgoods.SelectedItem.Value);
        model.navforum = int.Parse(this.navforum.SelectedItem.Value);
        model.Displayfailure = int.Parse(this.displayfailure.SelectedItem.Value);
        model.Teamask = int.Parse(this.teamask.SelectedItem.Value);
        model.Creditseconds = int.Parse(this.creditseconds.SelectedItem.Value);
        model.Smssubscribe = int.Parse(this.smssubscribe.SelectedItem.Value);
        model.Trsimple = int.Parse(this.trsimple.SelectedItem.Value);
        model.Moneysave = int.Parse(this.moneysave.SelectedItem.Value);
        model.cateteam = int.Parse(this.cateteam.SelectedItem.Value);
        model.Catepartner = int.Parse(this.catepartner.SelectedItem.Value);
        model.Citypartner = int.Parse(this.citypartner.SelectedItem.Value);
        model.Cateseconds = int.Parse(this.cateseconds.SelectedItem.Value);
        model.Categoods = int.Parse(this.categoods.SelectedItem.Value);
        model.Emailverify = int.Parse(this.emailverify.SelectedItem.Value);
        model.Needmobile = int.Parse(this.needmobile.SelectedItem.Value);
        model.GouwuChe = int.Parse(this.gouwuChe.SelectedItem.Value);
        try
        {
            this.result = true;
            model.Guowushu = int.Parse(base.Request["txtshu"]);
        }
        catch (Exception)
        {
            this.SetError("输入的购物数格式不正确，设置失败");
            base.Response.Redirect("~/webpage/SheZhi_XuanXiang.aspx");
        }
        if (this.result)
        {
            this.systems.Update(model);
            base.SetSuccess("设置成功");
            base.Response.Redirect("~/webpage/SheZhi_XuanXiang.aspx");
            base.Response.End();
        }
    }

    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        this.HeaderControl1.Select = "shezhi";
        if (!base.IsPostBack)
        {
            this.viewSystem();
        }
    }

    private void viewSystem()
    {
        ListItem item = new ListItem();
        item.Text = "是";
        item.Value = "1";
        ListItem item2 = new ListItem();
        item2.Text = "否";
        item2.Value = "0";
        ListItem item3 = new ListItem();
        item3.Text = "是";
        item3.Value = "1";
        ListItem item4 = new ListItem();
        item4.Text = "否";
        item4.Value = "0";
        ListItem item5 = new ListItem();
        item5.Text = "是";
        item5.Value = "1";
        ListItem item6 = new ListItem();
        item6.Text = "否";
        item6.Value = "0";
        ListItem item7 = new ListItem();
        item7.Text = "是";
        item7.Value = "1";
        ListItem item8 = new ListItem();
        item8.Text = "否";
        item8.Value = "0";
        ListItem item9 = new ListItem();
        item9.Text = "是";
        item9.Value = "1";
        ListItem item10 = new ListItem();
        item10.Text = "否";
        item10.Value = "0";
        ListItem item11 = new ListItem();
        item11.Text = "是";
        item11.Value = "1";
        ListItem item12 = new ListItem();
        item12.Text = "否";
        item12.Value = "0";
        ListItem item13 = new ListItem();
        item13.Text = "是";
        item13.Value = "1";
        ListItem item14 = new ListItem();
        item14.Text = "否";
        item14.Value = "0";
        ListItem item15 = new ListItem();
        item15.Text = "是";
        item15.Value = "1";
        ListItem item16 = new ListItem();
        item16.Text = "否";
        item16.Value = "0";
        ListItem item17 = new ListItem();
        item17.Text = "是";
        item17.Value = "1";
        ListItem item18 = new ListItem();
        item18.Text = "否";
        item18.Value = "0";
        ListItem item19 = new ListItem();
        item19.Text = "是";
        item19.Value = "1";
        ListItem item20 = new ListItem();
        item20.Text = "否";
        item20.Value = "0";
        ListItem item21 = new ListItem();
        item21.Text = "是";
        item21.Value = "1";
        ListItem item22 = new ListItem();
        item22.Text = "否";
        item22.Value = "0";
        ListItem item23 = new ListItem();
        item23.Text = "是";
        item23.Value = "1";
        ListItem item24 = new ListItem();
        item24.Text = "否";
        item24.Value = "0";
        item24.Selected = true;
        ListItem item25 = new ListItem();
        item25.Text = "是";
        item25.Value = "1";
        ListItem item26 = new ListItem();
        item26.Text = "否";
        item26.Value = "0";
        ListItem item27 = new ListItem();
        item27.Text = "是";
        item27.Value = "1";
        ListItem item28 = new ListItem();
        item28.Text = "否";
        item28.Value = "0";
        ListItem item29 = new ListItem();
        item29.Text = "是";
        item29.Value = "1";
        ListItem item30 = new ListItem();
        item30.Text = "否";
        item30.Value = "0";
        ListItem item31 = new ListItem();
        item31.Text = "是";
        item31.Value = "1";
        ListItem item32 = new ListItem();
        item32.Text = "否";
        item32.Value = "0";
        ListItem item33 = new ListItem();
        item33.Text = "是";
        item33.Value = "1";
        ListItem item34 = new ListItem();
        item34.Text = "否";
        item34.Value = "0";
        ListItem item35 = new ListItem();
        item35.Text = "是";
        item35.Value = "1";
        ListItem item36 = new ListItem();
        item36.Text = "否";
        item36.Value = "0";
        ListItem item37 = new ListItem();
        item37.Text = "是";
        item37.Value = "1";
        ListItem item38 = new ListItem();
        item38.Text = "否";
        item38.Value = "0";
        foreach (Maticsoft.Model.System system in this.systems.GetModelList("Id=1"))
        {
            if (system.Navpartner == 1)
            {
                item.Selected = true;
            }
            else
            {
                item2.Selected = true;
            }
            if (system.Navseconds == 1)
            {
                item3.Selected = true;
            }
            else
            {
                item4.Selected = true;
            }
            if (system.Navgoods == 1)
            {
                item5.Selected = true;
            }
            else
            {
                item6.Selected = true;
            }
            if (system.navforum == 1)
            {
                item7.Selected = true;
            }
            else
            {
                item8.Selected = true;
            }
            if (system.GouwuChe == 1)
            {
                item9.Selected = true;
            }
            else
            {
                item10.Selected = true;
            }
            if (system.Displayfailure == 1)
            {
                item11.Selected = true;
            }
            else
            {
                item12.Selected = true;
            }
            if (system.Teamask == 1)
            {
                item13.Selected = true;
            }
            else
            {
                item14.Selected = true;
            }
            if (system.Creditseconds == 1)
            {
                item15.Selected = true;
            }
            else
            {
                item16.Selected = true;
            }
            if (system.Smssubscribe == 1)
            {
                item17.Selected = true;
            }
            else
            {
                item18.Selected = true;
            }
            if (system.Trsimple == 1)
            {
                item19.Selected = true;
            }
            else
            {
                item20.Selected = true;
            }
            if (system.Moneysave == 1)
            {
                item21.Selected = true;
            }
            else
            {
                item22.Selected = true;
            }
            if (system.cateteam == 1)
            {
                item25.Selected = true;
            }
            else
            {
                item26.Selected = true;
            }
            if (system.Catepartner == 1)
            {
                item27.Selected = true;
            }
            else
            {
                item28.Selected = true;
            }
            if (system.Citypartner == 1)
            {
                item29.Selected = true;
            }
            else
            {
                item30.Selected = true;
            }
            if (system.Cateseconds == 1)
            {
                item31.Selected = true;
            }
            else
            {
                item32.Selected = true;
            }
            if (system.Categoods == 1)
            {
                item33.Selected = true;
            }
            else
            {
                item34.Selected = true;
            }
            if (system.Emailverify == 1)
            {
                item35.Selected = true;
            }
            else
            {
                item36.Selected = true;
            }
            if (system.Needmobile == 1)
            {
                item37.Selected = true;
            }
            else
            {
                item38.Selected = true;
            }
        }
        this.navpartner.Items.Add(item);
        this.navpartner.Items.Add(item2);
        this.navseconds.Items.Add(item3);
        this.navseconds.Items.Add(item4);
        this.navgoods.Items.Add(item5);
        this.navgoods.Items.Add(item6);
        this.navforum.Items.Add(item7);
        this.navforum.Items.Add(item8);
        this.displayfailure.Items.Add(item11);
        this.displayfailure.Items.Add(item12);
        this.teamask.Items.Add(item13);
        this.teamask.Items.Add(item14);
        this.creditseconds.Items.Add(item15);
        this.creditseconds.Items.Add(item16);
        this.smssubscribe.Items.Add(item17);
        this.smssubscribe.Items.Add(item18);
        this.trsimple.Items.Add(item19);
        this.trsimple.Items.Add(item20);
        this.moneysave.Items.Add(item21);
        this.moneysave.Items.Add(item22);
        this.cateteam.Items.Add(item25);
        this.cateteam.Items.Add(item26);
        this.catepartner.Items.Add(item27);
        this.catepartner.Items.Add(item28);
        this.citypartner.Items.Add(item29);
        this.citypartner.Items.Add(item30);
        this.cateseconds.Items.Add(item31);
        this.cateseconds.Items.Add(item32);
        this.categoods.Items.Add(item33);
        this.categoods.Items.Add(item34);
        this.emailverify.Items.Add(item35);
        this.emailverify.Items.Add(item36);
        this.needmobile.Items.Add(item37);
        this.needmobile.Items.Add(item38);
        this.gouwuChe.Items.Add(item9);
        this.gouwuChe.Items.Add(item10);
        this.navpartner.DataBind();
        this.navseconds.DataBind();
        this.navgoods.DataBind();
        this.navforum.DataBind();
        this.displayfailure.DataBind();
        this.teamask.DataBind();
        this.creditseconds.DataBind();
        this.smssubscribe.DataBind();
        this.trsimple.DataBind();
        this.moneysave.DataBind();
        this.cateteam.DataBind();
        this.catepartner.DataBind();
        this.citypartner.DataBind();
        this.cateseconds.DataBind();
        this.categoods.DataBind();
        this.emailverify.DataBind();
        this.needmobile.DataBind();
        this.gouwuChe.DataBind();
    }
}


